//
//  ViewController33.swift
//  BankOfChina
//
//  Created by mac on 2023/11/19.
//

import UIKit
import SnapKit
class ViewController33: UIViewController {
    lazy var progressView:UIProgressView = {
       let progress = UIProgressView.init()
        progress.trackTintColor = UIColor.white
        progress.progressTintColor = UIColor(hex: "#E7514B")
        progress.progress = 0.01
        return progress
    }()
    @IBOutlet weak var maskImageView: UIImageView!
    override var preferredStatusBarStyle: UIStatusBarStyle {
      return .default
    }
    override func viewDidLoad() {
        super.viewDidLoad()

        self.view.addSubview(self.progressView)
        self.progressView.snp.makeConstraints { make in
            make.left.right.equalToSuperview()
            make.top.equalTo(44)
            make.height.equalTo(2)
        }
        
        GCDTimer.start(1, 60) {isFinish,count,intTimeCount in
            if intTimeCount == 2 {
                self.maskImageView.isHidden = true
            }
            self.progressView.progress = Float(0.58 * intTimeCount)
            if (self.progressView.progress > 0.65){
                self.progressView.isHidden = true
            }
        }
    }
    
    @IBAction func back(_ sender: Any) {
        self.dismiss(animated: false)
        NotificationCenter.default.post(name: NSNotification.Name(rawValue: "back") , object: nil)
    }
    
    @IBAction func push44(_ sender: Any) {
        let storyboard = UIStoryboard(name: "Main", bundle: nil)
        let vc11 = storyboard.instantiateViewController(withIdentifier: "ViewController")
        vc11.modalPresentationStyle = .currentContext
        self.present(vc11, animated: false)
    }
    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}
